package cn.w.outdoor.lib.common;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class CommonTimeMethods {
    private static final CommonTimeMethods ourInstance = new CommonTimeMethods();

    public static CommonTimeMethods getInstance() {
        return ourInstance;
    }

    private CommonTimeMethods() {
    }

    public String getFormattedTime(String formatterPattern) {
        return getFormattedTime(formatterPattern, new Date(), Locale.SIMPLIFIED_CHINESE);
    }

    public String getFormattedTime(String formatterPattern, Date date) {
        return getFormattedTime(formatterPattern, date, Locale.SIMPLIFIED_CHINESE);
    }

    public String getFormattedTime(String formatterPattern, Date date, Locale locale) {
        return new SimpleDateFormat(formatterPattern, locale).format(date);
    }

}
